import { ref, onMounted, onUnmounted, nextTick, reactive } from 'vue'
import { debounce } from 'lodash-es'

/**
 * description: 获取页面宽度
 */

export function useContentHeight() {
  let contentHeight = ref<number>(0)
  nextTick(() => {
    const contentDom = document.querySelector('#content-wrap') as HTMLElement
    contentHeight.value = contentDom.offsetHeight
    // console.log(contentHeight.value);
    let a = contentDom.children
    console.log('[ a ]-15', a)
  })

  /*   function resize() {
    domWidth.value = document.body.clientWidth
  } */

  /*   onMounted(() => {
    window.addEventListener('resize', debounce(resize, 80))
  })
  onUnmounted(() => {
    window.removeEventListener('resize', resize)
  })
 */
  return contentHeight
}
